import request from '@/utils/request'

export function addStudentSign(data) {
  return request({
    method: 'post',
    url: 'student/sign',
    data: data
  }, true)
}

export function getBookCourses(params) {
  return request({
    url: 'student/getBookCourses',
    method: 'get',
    params
  })
}

export function bookCourse(data) {
  return request({
    method: 'post',
    url: 'student/bookCourse',
    data: data
  }, true)
}

export function quitCourse(params) {
  return request({
    method: 'get',
    url: 'student/quitCourse',
    params
  }, true)
}

export function selectClass(data) {
  return request({
    method: 'post',
    url: 'student/selectClass',
    data: data
  }, true)
}

export function getStudentAccount(params) {
  return request({
    url: 'student/account',
    method: 'get',
    params
  })
}

export function getStudentConsumeList(params) {
  return request({
    url: 'student/consumeList',
    method: 'get',
    params
  })
}

export function getStudentSchedule(params) {
  return request({
    url: 'student/schedule/list',
    method: 'get',
    params
  })
}

export function getStudentGuardian(params) {
  return request({
    url: 'student/guardian',
    method: 'get',
    params
  })
}

export function getStudentInfo(params) {
  return request({
    url: 'student/detail',
    method: 'get',
    params
  })
}

export function update(data) {
  return request({
    url: 'student/update',
    method: 'post',
    data: data
  })
}

export function addRecharge(data) {
  return request({
    url: 'student/recharge',
    method: 'post',
    data: data
  })
}

export function refund(data) {
  return request({
    url: 'student/refund',
    method: 'post',
    data: data
  })
}

export function listSimpleStudent(name) {
  return request({
    url: 'student/simple/list',
    method: 'get',
    params: {
      name: name
    }
  }, true)
}
